<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('查询手机号')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-info-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户ID：</label>
                <div class="col-sm-8">
                    <input name="uid" id="uid" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3"></label>
                <div class="col-sm-8">
                    <button class="btn-primary" type="button" onclick="submitHandler()">查询</button>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">手机号:</label>
                <div class="col-sm-8">
                    <input id="mobileData" readonly class="form-control" type="text">
                </div>
            </div>
        </form>

    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "member/info"

        function submitHandler() {

            var uid = $("#uid").val();
            if (uid == '' || uid == undefined){
                $.modal.alertWarning("请输入用户ID")
                return;
            }

            $.ajax({
                type: "post",
                url: prefix + "/queryMobileData",
                data: {
                    'uid': uid
                },
                dataType: 'json',
                success: function(result) {
                    if (result.code == 0) {
                         $("#mobileData").val(result.data.mobile);
                    }
                },
            });
        }

    </script>
</body>
</html>